package com.slofzx.nuoda.evaluation.project.enums;

import com.slofzx.nuoda.common.enums.SysPermission;

/**
 * 系统权限枚举
 * @author sunfuyong
 */
public enum PermissionEnum implements SysPermission {
    EVALUATION_AUDIT("evaluation:audit", "经济评价审核", "项目经济评价审核权限"),

    BATCH_VIEW  ("batch:view", "评价任务查看", "评价任务查看权限"),
    BATCH_QUERY_ALL  ("batch_query:all", "评价任务查看所有", "评价任务查看所有权限"),
    BATCH_CREATE("batch:create", "评价任务创建", "评价任务创建权限"),
    BATCH_UPDATE("batch:update", "评价任务编辑", "评价任务编辑权限"),
    BATCH_DELETE("batch:delete", "评价任务删除", "评价任务删除权限"),
    PLAN_VIEW("plan:view", "评价方案查看", "评价任务查看权限"),
    PLAN_QUERY_ALL("plan_query:all", "评价方案查看所有", "评价任务查看所有项目"),
    PLAN_CREATE("plan:create", "评价方案创建", "评价任务创建权限"),
    PLAN_UPDATE("plan:update", "评价方案编辑", "评价任务编辑权限"),
    PLAN_DELETE("plan:delete", "评价方案删除", "评价任务删除权限"),
   // MODEL_PARAM_MAP("model_param:map", "评价模型关联", "评价模型关联权限"),
    PROJECT_QUERY_ALL("project_query:all", "查看所有项目权限", "可查看本公司及下属单位所有项目"),
    PROJECT_COMPUTE_LOG_DOWNLOAD("project_compute_log:download", "项目计算日志下载", "对项目计算详情日志进行下载"),
    SYSTEM_TEMPLATE_VIEW(  "system_template:view", "系统模板查询", "导出系统模板查询权限"),
    SYSTEM_TEMPLATE_CREATE("system_template:create", "系统模板创建", "导出系统模板创建权限"),
    SYSTEM_TEMPLATE_UPDATE("system_template:update", "系统模板更新", "导出系统模板更新权限"),
    SYSTEM_TEMPLATE_DELETE("system_template:delete", "系统模板删除", "导出系统模板删除权限"),
    ANALYSIS_TEND_VIEW  ("analysis_tend:view", "趋势分析查看", "趋势分析查看权限"),
    ANALYSIS_VIEW("analysis:view", "统计分析查看", "统计分析查看权限"),
    REPORT_VIEW("report:view", "报告管理查看", "报告管理查看权限"),
    REPORT_CREATE("report:upload", "报告管理上传", "报告管理上传权限"),
    REPORT_DELETE("report:delete", "报告管理删除", "报告管理删除权限"),
    //REPORT_DOWN("report:down", "趋势分析查看", "趋势分析查看权限"),
    BUILD_VIEW("build:view", "建设单位管理查看", "建设单位管理查看权限"),
    PROJECT_DELETE("project:delete", "项目管理删除", "项目管理删除权限"),
    COMPUTE_VERSION_RECORD("compute_version:record","评价版本维护","评价版本维护权限"),
    COMPUTE_VERSION_DELETE("compute_version:delete","评价版本删除","评价版本删除权限"),
    PLAN_UNLOCK("plan:unlock","方案解锁","方案解锁权限"),
    ;

    private String desc;
    private String id;
    private String name;

    @Override
    public String getDescription() {
        return this.desc;
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public String getName() {
        return this.name;
    }

    PermissionEnum(String id, String name, String desc) {
        this.id = id;
        this.name = name;
        this.desc = desc;
    }

    public static PermissionEnum getEnum(String id) {
        for(PermissionEnum value: PermissionEnum.values()) {
            if (value.getId().equals(id)) {
                return value;
            }
        }

        return null;
    }
}
